@import "@styles/theme.scss";

.home-pin {
  padding: 0 30px;
  background: #ffffff;
}

.home-pin__banner {
  display: flex;
  flex-direction: column;

  &-item {
    display: flex;
    flex-direction: row;

    &-img {
      width: 100%;
      height: 170px;
    }
  }
}

/**
 * // NOTE RN Swiper 的 indicator 位置与 H5、小程序不同
 * 这边通过 height + 负 margin 实现一致样式，或者自己实现 indicator 也不难
 */
.home-pin__wrap {
  margin: -100px 0 -20px;
  height: 450px;
  overflow: hidden;

  @include eject(margin, 0);
  @include eject(height, 340px);
}

.home-pin__swiper {
  // NOTE RN 的 Swiper 需要有高度，否则会报错
  height: 330px;

  &-item {
    display: flex;
    flex-direction: row;
  }
}

.home-pin__item {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 10px;
  overflow: hidden;

  &-img {
    width: 216px;
    height: 216px;
    border-radius: $border-radius;
  }

  &-info {
    display: flex;
    flex-direction: row;
    justify-content: center;
    margin-top: 20px;
  }

  &-price {
    color: $primary-color;
    font-size: 24px;
    line-height: 24px;
  }

  &-origin {
    padding-left: 8px;
    color: $text-color-lighter;
    font-size: 24px;
    font-weight: 200;
    line-height: 24px;
    text-decoration: line-through;
    text-decoration-color: $text-color-lighter;
  }

  &-num {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 132px;
    height: 48px;
    background: #ff7d05;
    border-radius: 8px 0;
    // NOTE RN 不支持 transform-origin 属性，可通过 translate 纠正
    transform: scale(0.5) translate(-33px, -12px);
    @include eject(transform, scale(0.5) translate(-66px, -24px));

    &-txt {
      color: #ffffff;
      font-size: 36px;
    }
  }
}
